#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;

void solve()
{
    ll a,b;
    cin>>a>>b;
    if(a<=2 || b<=2)
    {
        cout<<"niuniu"<<endl;
        return;
    }
    if(a>b) swap(a,b);
    if(a%3==2 || (a%3==1 && b!=a) )
    {
        cout<<"niuniu"<<endl;
    }
    else cout<<"niumei"<<endl;
    return;
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        solve();
    }
    
    return 0;
}
